package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SystemType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
/**
 * Created by zhangjh on 2017/3/29.
 *
 * 默认权限
 */
@Entity
@Table(name = "auth_user_resource_default")
@DynamicInsert
@DynamicUpdate
public class AuthUserResourceDefault extends IDEntityMall {

    /**
     * 用户id
     */
    @Column(columnDefinition = "bigint comment '用户id'")
    private Long userId;

    /**
     * 平台id
     */
    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;

    /**
     * 平台id
     */
    @Column(columnDefinition = "bigint comment '平台id'")
    private Long userAdminId;

    /**
     * 商家id
     */
    @Column(columnDefinition = "bigint comment '商家id'")
    private Long merchantId;
    /**
     * 菜单资源id
     */
    @Column(columnDefinition = "bigint comment '菜单资源id'")
    private Long resourceId;

    /**
     * 菜单资源父id
     */
    @Column(columnDefinition = "bigint comment '菜单资源父id'")
    private Long resourceParentId;

    /**
     * 系统类型
     */
    @Column(columnDefinition = "varchar(50) comment '系统类型 ADMIN(\"R端\"),MALL(\"M端\"),MERCHANT(\"B端\")'")
    @Enumerated(EnumType.STRING)
    private SystemType systemType;


    public Long getResourceParentId() {
        return resourceParentId;
    }

    public void setResourceParentId(Long resourceParentId) {
        this.resourceParentId = resourceParentId;
    }

    public Long getResourceId() {
        return resourceId;
    }

    public void setResourceId(Long resourceId) {
        this.resourceId = resourceId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getUserAdminId() {
        return userAdminId;
    }

    public void setUserAdminId(Long userAdminId) {
        this.userAdminId = userAdminId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }


    public SystemType getSystemType() {
        return systemType;
    }

    public void setSystemType(SystemType systemType) {
        this.systemType = systemType;
    }

    @Override
    public String toString() {
        return "AuthUserResourceDefault{" +
                "userId=" + userId +
                ", id=" + id +
                ", mallId=" + mallId +
                ", dateCreated=" + dateCreated +
                ", userAdminId=" + userAdminId +
                ", lastUpdated=" + lastUpdated +
                ", merchantId=" + merchantId +
                ", resourceId=" + resourceId +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", resourceParentId=" + resourceParentId +
                ", systemType=" + systemType +
                '}';
    }
}
